package com.lw.io.bytestream.copy;

import java.io.*;

public class CopyImage {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = new FileInputStream("wordcup.alicdn.webp");  //建立输入流
        OutputStream outputStream = new FileOutputStream("java-study-IO\\wordcup.jpg"); //建立输出流
        byte[] bytes = new byte[1024]; //申请一个字节数组  1K。
        int len=0;
        while((len=inputStream.read(bytes)) != -1){
            System.out.println(len);
            outputStream.write(bytes,0,len);

        }
        outputStream.close();
        inputStream.close();


    }
}

